<template>
  <div class="content">
    <van-nav-bar title="预约课程" left-arrow @click-left="onClickLeft" />

    <div class="list">
      <img :src="list.teacher.avatar" alt v-if="list.teacher" />
      <div>
        <p v-if="list.teacher">{{ list.teacher.teacher_name }}</p>
        <p v-if="list.teacher">
          {{ list.teacher.sex == 1 ? "女" : "男" }}
          <span>{{ list.teacher.teach_age }}</span>
        </p>
      </div>
      <span class="detail">查看详情</span>
    </div>

    <div class="button">
      <p>
        选择时间<span>(北京时间)</span>
      </p>
    </div>
  </div>
</template>

<script>
import { sjkReserved } from "../../utils/http";
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    this.getlist();
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    getlist() {
      sjkReserved(this.$route.params.id).then((res) => {
        console.log(res);
        this.list = res;
      });
    },
  },
};
</script>

<style scoped>
.content{
  background-color: #F0F2F5;
}
.van-nav-bar {
  height: 100px;
  background-color: #60affa;
}
.van-nav-bar >>> .van-nav-bar__title {
  color: white;
  font-size: 18px;
}
.van-nav-bar >>> .van-icon {
  color: white;
}
.list {
  z-index: 99999;
  width: 87%;
  display: flex;
  padding: 0 15px;
  background: white;
  margin: 0 10px;
  height: 81px;
  align-items: center;
  border-radius: 5px;
  position: absolute;
  top: 45px;
}
.list img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}
.list div {
  flex: 1;
}
.list div p:nth-of-type(1) {
  font-size: 18px;
  color: #595959;
}
.list div p:nth-of-type(2) {
  font-size: 12px;
  color: #b7b7b7;
  margin-top: 5px;
}
.detail{
  width: 80px;
  height: 25px;
  text-align: center;
  line-height: 25px;
  border-radius: 20px;
  border: 1px solid red;
  color: red;
  font-size: 14px;
}
.button{
  width: 100%;
  height: 50px;
  padding-left: 10px;
  margin-top: 24px;
}
.button p{
  display: inline-block;
  height: 20px;
  line-height: 20px;
  margin-top: 14px;
  padding-left: 8px;
  font-size: 16px;
  color: gray;
  border-left: 3px solid red;

}
.button p span{
  display: inline-block;
  margin-left: 10px;
}

</style>
